<template>
  <div class="block-box">
    <div class="block-box_item">
      <div class="block-box_title">记录详情</div>
      <eagle-cell-group>
        <!-- <eagle-input
          label="检查机构"
          :value="form.CreateChnNam || '没有字段'"
          readonly
        ></eagle-input> -->

        <eagle-input
          label="检查人"
          :value="form.CreateChnName"
          readonly
        ></eagle-input>

        <eagle-input
          label="检查日期"
          :value="getDateTime(form.CreateDate)"
          readonly
        ></eagle-input>

        <eagle-input
          label="被检查企业"
          :value="form.CheckTaskName "
          readonly
        ></eagle-input>

        <eagle-input
          label="最新状态"
          :value="form.StatusName"
          readonly
        ></eagle-input>

        <eagle-input
          label="来源"
          :value="
            form.OriginType == 1
              ? '检查表检查'
              : form.StatusName == 2
              ? '依据检查'
              : '随手拍'
          "
          readonly
        ></eagle-input>

        <eagle-input
          v-if="form.OriginType == 1"
          label="检查内容"
          :value="form.DetailItemName"
          rows="1"
          autosize
          readonly
        ></eagle-input>

        <eagle-input
          label="检查结果"
          :value="
            form.CheckResult == 'N'
              ? '不符合'
              : form.CheckResult == 'NA'
              ? '不适用'
              : '符合'
          "
          readonly
        ></eagle-input>

        <div v-if="form.CheckResult == 'N'">
          <eagle-input
            name="Attachs"
            label="隐患图片"
          >
            <template #input>
              <eagle-image-preview :images="form.Attachs"></eagle-image-preview>
            </template>
          </eagle-input>

          <eagle-input
            label="隐患区域"
            type="textarea"
            rows="1"
            :value="form.HiddenDangerArea"
            autosize
            readonly
          ></eagle-input>

          <eagle-input
            label="隐患描述"
            type="textarea"
            rows="1"
            :value="form.HiddenDangerDesc"
            autosize
            readonly
          ></eagle-input>

          <eagle-input
            label="隐患分类"
            :value="form.LGDFullName"
            readonly
          ></eagle-input>
          <eagle-input
            label="隐患性质"
            :value="form.HiddenDangerTypeName"
            readonly
          ></eagle-input>
          <eagle-input
            v-if="form.GistSource"
            label="依据来源"
            type="textarea"
            rows="1"
            :value="form.GistSource"
            autosize
            readonly
          ></eagle-input>

          <eagle-input
            v-if="form.GistSource"
            label="整改建议"
            type="textarea"
            rows="1"
            :value="form.CorrectiveAdvise || '无'"
            autosize
            readonly
          ></eagle-input>


          <eagle-input
            v-if="form.Status >= 40"
            label="整改方式"
            :value="form.CorrectiveMethod == 1 ? '立即整改' : '限期整改'"
            readonly
          ></eagle-input>
          <eagle-input
            v-if="form.Status >= 40 && form.CorrectiveMethod == 2"
            label="整改日期"
            :value="getDate(form.CorrectiveDate)"
            readonly
          ></eagle-input>

          <eagle-input
            v-if="form.Status >= 40 && form.CorrectiveMethod == 2"
            label="整改措施"
            type="textarea"
            autosize
            :value="form.CorrectiveMeasure"
            readonly
          ></eagle-input>

            <eagle-input
            v-if="form.Status >= 60"
            name="CorrectiveAttachs"
            label="验收图片"
            readonly
          >
            <template #input>
              <eagle-image-preview :images="form.VerifyAttachs"></eagle-image-preview>
            </template>
          </eagle-input>

        </div>
      </eagle-cell-group>
    </div>
    <div class="block-box_item mt-10" v-if="form.Status > 20">
      <div class="block-box_title">操作历史记录</div>
      <div class="operate_list">
        <eagle-row class="operate_row_first">
          <eagle-col span="4">序号</eagle-col>
          <eagle-col offset="1" span="10">操作</eagle-col>
        </eagle-row>
        <eagle-row
          v-for="(item, index) in form.LogList"
          :key="index"
          class="operate_row"
        >
          <eagle-col span="4">{{ index + 1 }}</eagle-col>
          <eagle-col offset="1" span="18">
            {{ item.OperateLog }}
            <div v-if="item.Attachs">
              <eagle-image-preview :images="item.Attachs"></eagle-image-preview>
            </div>
          </eagle-col>
        </eagle-row>
      </div>
    </div>
  </div>
</template>

<script>
import { getDate, getDateTime } from "@/utils/getDate";
import ImagePreview from "../../../components/ImagePreview.vue";
export default {
  components: { ImagePreview },
  props: {
    form: {},
  },
  data() {
    return {};
  },
  methods: {
    getDate(value) {
      return getDate(value);
    },
    getDateTime(value) {
      return getDateTime(value);
    },
  },
};
</script>

<style lang="less" scoped>
.operate_list {
  font-size: 12px;
  line-height: 16px;
  border: 1px solid #e8f1f8;
  .operate_row_first {
    padding: 10px;
    background-color: #e8f1f8;
    border-bottom: 1px solid #e8f1f8;
    margin-bottom: 10px;
  }
  .operate_row {
    padding: 10px;
    border-bottom: 1px solid #e8f1f8;
      line-height: 16px;
  }
}

 /deep/ .van-cell{
  padding-left:0px;
  padding-right:0px;
}
</style>
